<?php


namespace App\Http\Controllers\admin\validate;


use Illuminate\Support\Facades\Validator;

class Gankao
{

    public static function editCardInfo($param){
        $rules = [
            'userId'=>'required|numeric',
            'lastIp'=>'required|ip',
            'sn'=>'required',
            'card_info'=>'required',
        ];
        $msg = [
            'userId.required'=>'用户编号为空',
            'userId.numeric'=>'用户编号格式不对',
            'lastIp.required'=>'IP地址为空',
            'lastIp.ip'=>'IP地址格式不对',
            'sn.required'=>'sn码为空',
            'card_info.required'=>'套餐为空',

        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function cancelCardInfo($param){
        $rules = [
            'userId'=>'required|numeric',
            'lastIp'=>'required|ip',
            'sn'=>'required',
        ];
        $msg = [
            'userId.required'=>'用户编号为空',
            'userId.numeric'=>'用户编号格式不对',
            'lastIp.required'=>'IP地址为空',
            'lastIp.ip'=>'IP地址格式不对',
            'sn.required'=>'sn码为空',

        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function upgrade($param){
        $rules = [
            'userId'=>'required|numeric',
            'lastIp'=>'required|ip',
            'sn'=>'required',
        ];
        $msg = [
            'userId.required'=>'用户编号为空',
            'userId.numeric'=>'用户编号格式不对',
            'lastIp.required'=>'IP地址为空',
            'lastIp.ip'=>'IP地址格式不对',
            'sn.required'=>'sn码为空',

        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }


}